<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<style>

table.spreadsheet {
	margin: 20px 0;
	border: #999 3px solid;
}

table.spreadsheet th {
	background: #ccc;
	font-weight: bold;
	font-size: 14px;
	padding: 10px 10px;
}

table.spreadsheet td {
	border-top: #999 1px solid;
	padding: 10px 15px;
}

</style>
	</head>
	<body>
		<div id="container">
			<div id="title">
				<h1>Quản Lý Module</h1>
				<p>Dưới đây là danh sách các module. Bạn có thể thêm mới hay gỡ bỏ module.</p>
			</div>
			<div id="content">
				<?php
		echo '<table align="center" border="1" cellspacing="2" cellpadding="2">
		<tr>
		<td align="left"><b></b></td>
		<td align="left"><b>name</b></td>
		<td align="left"><b>description</b></td>
		<td align="left"><b>thumbnail</b></td>
		<td align="left"><b>author</b></td>
		<td align="left"><b>email</b></td>
		<td align="left"><b>version</b></td>
		<td align="left"><b>license</b></td>
		</tr>';
		foreach ($this->modules as $row)
		{ 
			$install = '/Apprentice_CMS/public/admin/module/install/name/'.$row['name'];
			$unInstall = '/Apprentice_CMS/public/admin/module/uninstall/name/'.$row['name'];
			
			if ($this->dbModules[strtolower($row['name'])] == null)
				echo "<td><a href='$install'>Install</a>";
			else  echo "<td><a href='$unInstall'>Uninstall</a>";
			
			echo '</td><td align=\"left\">';
			echo $row['name'];
			echo '</td><td align=\"left\">';
			echo $row['description'];
			echo '</td><td align=\"left\">';
			echo $row['thumbnail'];
			echo '</td><td align=\"left\">';
			echo $row['author'];
			echo '</td><td align=\"left\">';
			echo $row['email'];
			echo '</td><td align=\"left\">';
			echo $row['version'];
			echo '</td><td align=\"left\">';
			echo $row['license'];
			echo '</td></tr>';
		}
		
		echo '</table>';
		

		
		
		echo "<form action='#' method='post' enctype='multipart/form-data'>";
		echo "<input type='file' name='file' />";
		echo "<input type='submit' name='btnsubmit' value='Upload' />";
		echo "</form>";
		if ($this->ErrorMessage){
			echo "Can not uncompressed!";
		}
		

?>
			</div>
	
	</div>
	</body>
</html>


